ViewPageBase<TModel>
Assembly: ServiceStack.Razor.dll
View Source
Declaration
public abstract class ViewPageBase<TModel> : RenderingPage, IHasModel
Properties
Layout
View Source
Declaration
public string Layout { get; set; }
Model
View Source
Declaration
public TModel Model { get; set; }
ModelType
View Source
Declaration
public abstract Type ModelType { get; }
ViewEngine
View Source
Declaration
public virtual IViewEngine ViewEngine { get; set; }
AppHost
View Source
Declaration
public IAppHost AppHost { get; set; }
DebugMode
View Source
Declaration
public bool DebugMode { get; }
AppSettings
View Source
Declaration
public IAppSettings AppSettings { get; }
Gateway
View Source
Declaration
public virtual IServiceGateway Gateway { get; }
IsError
View Source
Declaration
public bool IsError { get; }
ModelError
View Source
Declaration
public object ModelError { get; set; }
PathBase
View Source
Declaration
public string PathBase { get; }
VirtualFiles
View Source
Declaration
public IVirtualFiles VirtualFiles { get; }
VirtualFileSources
View Source
Declaration
public IVirtualPathProvider VirtualFileSources { get; }
Cache
View Source
Declaration
public ICacheClient Cache { get; }
CacheAsync
View Source
Declaration
public ICacheClientAsync CacheAsync { get; }
Db
View Source
Declaration
public IDbConnection Db { get; }
Redis
View Source
Declaration
public IRedisClient Redis { get; }
MessageProducer
View Source
Declaration
public virtual IMessageProducer MessageProducer { get; }
AuthRepository
View Source
Declaration
public IAuthRepository AuthRepository { get; }
AuthRepositoryAsync
View Source
Declaration
public IAuthRepositoryAsync AuthRepositoryAsync { get; }
SessionBag
View Source
Declaration
public virtual ISession SessionBag { get; }
UserSession
View Source
Declaration
protected virtual IAuthSession UserSession { get; }
IsAuthenticated
View Source
Declaration
public bool IsAuthenticated { get; }
SessionKey
View Source
Declaration
public string SessionKey { get; }
IsPostBack
View Source
Declaration
public bool IsPostBack { get; }
DialectProvider
View Source
Declaration
public IOrmLiteDialectProvider DialectProvider { get; }
Inherited Properties
ChildBody
View Source
Declaration
public string ChildBody { get; set; }
ChildPage
View Source
Declaration
public IRazorView ChildPage { get; set; }
Output
View Source
Declaration
public virtual StreamWriter Output { get; set; }
ParentPage
View Source
Declaration
public IRazorView ParentPage { get; set; }
Request
View Source
Declaration
public IRequest Request { get; set; }
Response
View Source
Declaration
public IResponse Response { get; set; }
TypedViewBag
View Source
Declaration
public IViewBag TypedViewBag { get; }
ViewBag
View Source
Declaration
public dynamic ViewBag { get; set; }
Fields
Url
View Source
Declaration
public UrlHelper Url
Methods
SetModel(Object)
View Source
Declaration
public virtual void SetModel(object o)
Parameters
Type | Name |
---|---|
System.Object | o |
Get<T>()
View Source
Declaration
public virtual T Get<T>()
Returns
<T>
Type Parameters
T
GetPlugin<T>()
View Source
Declaration
public virtual T GetPlugin<T>()
where T : class, IPlugin
Returns
<T>
Type Parameters
T
TryResolve<T>()
View Source
Declaration
public virtual T TryResolve<T>()
Returns
<T>
Type Parameters
T
ResolveService<T>()
View Source
Declaration
public virtual T ResolveService<T>()
Returns
<T>
Type Parameters
T
GetSession(Boolean)
View Source
Declaration
public virtual IAuthSession GetSession(bool reload = false)
Returns
ServiceStack.Auth.IAuthSession
Parameters
Type | Name |
---|---|
System.Boolean | reload |
SessionAs<T>()
View Source
Declaration
public virtual T SessionAs<T>()
where T : class, IAuthSession
Returns
<T>
Type Parameters
T
ClearSession()
View Source
Declaration
public void ClearSession()
Dispose()
View Source
Declaration
public virtual void Dispose()
Href(String)
View Source
Declaration
public string Href(string url)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | url |
Prepend(String)
View Source
Declaration
public void Prepend(string contents)
Parameters
Type | Name |
---|---|
System.String | contents |
GetErrorStatus()
View Source
Declaration
public ResponseStatus GetErrorStatus()
Returns
ResponseStatus
GetErrorMessage()
View Source
Declaration
public MvcHtmlString GetErrorMessage()
Returns
ServiceStack.Html.MvcHtmlString
GetAbsoluteUrl(String)
View Source
Declaration
public MvcHtmlString GetAbsoluteUrl(string virtualPath)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | virtualPath |
ApplyRequestFilters(Object)
View Source
Declaration
public void ApplyRequestFilters(object requestDto)
Parameters
Type | Name |
---|---|
System.Object | requestDto |
RedirectIfNotAuthenticated(String)
View Source
Declaration
public void RedirectIfNotAuthenticated(string redirectUrl = null)
Parameters
Type | Name |
---|---|
System.String | redirectUrl |
RedirectToAsync(String)
View Source
Declaration
public async Task RedirectToAsync(string path)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | path |
RedirectTo(String)
View Source
Declaration
public MvcHtmlString RedirectTo(string path)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | path |
HasRole(String)
View Source
Declaration
public bool HasRole(string role)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | role |
HasPermission(String)
View Source
Declaration
public bool HasPermission(string permission)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | permission |
AssertRole(String, String, String)
View Source
Declaration
public MvcHtmlString AssertRole(string role, string message = null, string redirect = null)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | role |
System.String | message |
System.String | redirect |
AssertRoleAsync(String, String, String)
View Source
Declaration
public async Task AssertRoleAsync(string role, string message = null, string redirect = null)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | role |
System.String | message |
System.String | redirect |
AssertPermission(String, String, String)
View Source
Declaration
public MvcHtmlString AssertPermission(string permission, string message = null, string redirect = null)
Returns
ServiceStack.Html.MvcHtmlString
Parameters
Type | Name |
---|---|
System.String | permission |
System.String | message |
System.String | redirect |
AssertPermissionAsync(String, String, String)
View Source
Declaration
public async Task AssertPermissionAsync(string permission, string message = null, string redirect = null)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.String | permission |
System.String | message |
System.String | redirect |
RenderErrorIfAny()
View Source
Declaration
public bool RenderErrorIfAny()
Returns
System.Boolean
GetErrorHtml()
View Source
Declaration
public MvcHtmlString GetErrorHtml()
Returns
ServiceStack.Html.MvcHtmlString
Inherited Methods
DefaultWriteLiteral(RenderingPage, String)
View Source
Declaration
public static void DefaultWriteLiteral(RenderingPage page, string str)
Parameters
Type | Name |
---|---|
ServiceStack.Razor.RenderingPage | page |
System.String | str |
DefaultWriteLiteralTo(RenderingPage, TextWriter, String)
View Source
Declaration
public static void DefaultWriteLiteralTo(RenderingPage page, TextWriter writer, string str)
Parameters
Type | Name |
---|---|
ServiceStack.Razor.RenderingPage | page |
System.IO.TextWriter | writer |
System.String | str |
DefineSection(String, Action)
View Source
Declaration
public virtual void DefineSection(string sectionName, Action action)
Parameters
Type | Name |
---|---|
System.String | sectionName |
System.Action | action |
Execute()
View Source
Declaration
public abstract void Execute()
IsSectionDefined(String)
View Source
Declaration
public virtual bool IsSectionDefined(string sectionName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | sectionName |
RenderBody()
View Source
Declaration
public object RenderBody()
Returns
System.Object
RenderChildSection(String, StreamWriter)
View Source
Declaration
public void RenderChildSection(string sectionName, StreamWriter writer)
Parameters
Type | Name |
---|---|
System.String | sectionName |
System.IO.StreamWriter | writer |
RenderSection(String)
View Source
Declaration
public object RenderSection(string sectionName)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | sectionName |
RenderSection(String, Boolean)
View Source
Declaration
public object RenderSection(string sectionName, bool required)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | sectionName |
System.Boolean | required |
SetChildPage(IRazorView, String)
View Source
Declaration
public void SetChildPage(IRazorView childPage, string childBody)
Parameters
Type | Name |
---|---|
ServiceStack.Html.IRazorView | childPage |
System.String | childBody |
Write(Object)
View Source
Declaration
public virtual void Write(object obj)
Parameters
Type | Name |
---|---|
System.Object | obj |
WriteAttribute(String, Tuple<String, Int32>, Tuple<String, Int32>, AttributeValue[])
View Source
Declaration
public virtual void WriteAttribute(string name, Tuple<string, int> prefix, Tuple<string, int> suffix, params AttributeValue[] values)
Parameters
Type | Name |
---|---|
System.String | name |
System.Tuple<System.String,System.Int32> | prefix |
System.Tuple<System.String,System.Int32> | suffix |
ServiceStack.Razor.AttributeValue[] | values |
WriteAttributeTo(TextWriter, String, Tuple<String, Int32>, Tuple<String, Int32>, AttributeValue[])
View Source
Declaration
public virtual void WriteAttributeTo(TextWriter writer, string name, Tuple<string, int> prefix, Tuple<string, int> suffix, params AttributeValue[] values)
Parameters
Type | Name |
---|---|
System.IO.TextWriter | writer |
System.String | name |
System.Tuple<System.String,System.Int32> | prefix |
System.Tuple<System.String,System.Int32> | suffix |
ServiceStack.Razor.AttributeValue[] | values |
WriteLiteral(String)
View Source
Declaration
public virtual void WriteLiteral(string str)
Parameters
Type | Name |
---|---|
System.String | str |
WriteLiteralTo(TextWriter, HelperResult)
View Source
Declaration
public virtual void WriteLiteralTo(TextWriter writer, HelperResult value)
Parameters
Type | Name |
---|---|
System.IO.TextWriter | writer |
ServiceStack.Html.HelperResult | value |
WriteLiteralTo(TextWriter, String)
View Source
Declaration
public void WriteLiteralTo(TextWriter writer, string literal)
Parameters
Type | Name |
---|---|
System.IO.TextWriter | writer |
System.String | literal |
WriteTo(TextWriter, HelperResult)
View Source
Declaration
public virtual void WriteTo(TextWriter writer, HelperResult value)
Parameters
Type | Name |
---|---|
System.IO.TextWriter | writer |
ServiceStack.Html.HelperResult | value |
WriteTo(TextWriter, Object)
View Source
Declaration
public virtual void WriteTo(TextWriter writer, object obj)
Parameters
Type | Name |
---|---|
System.IO.TextWriter | writer |
System.Object | obj |